<!--
 * @Author: 蔡继周
 * @Date: 2021-11-16 10:55:00
 * @LastEditTime: 2021-11-23 21:14:08
 * @LastEditors: Please set LastEditors
 * @Description: el-checkbox-group
-->
<template>
  <el-form-item
    rm-item
    :label="column.title ? column.title + '：' : ''"
    :prop="column.name"
    :rules="rules"
  >
    <el-checkbox-group
      v-model="value"
      @change="(value) => column.change && column.change(value)"
      v-bind="column.definProps"
    >
      <el-checkbox
        v-for="checkbox in column.options"
        :key="checkbox"
        :label="checkbox"
      >
        {{ checkbox }}
      </el-checkbox>
    </el-checkbox-group>
  </el-form-item>
</template>
<script setup>
import { computed } from "vue";
import useComputedRule from "./../hooks/useComputedRule";
const emit = defineEmits(["update:model"]);
const props = defineProps({
  column: {
    type: Object,
    default: () => {},
  },
  model: {
    type: Array,
    default: () => [],
  },
});
const { rules } = useComputedRule(props);
const name = "aaa"
const value = computed({
  get: () => props.model,
  set: (val) => {
    emit("update:model", val);
  },
});

</script>
